﻿<Serializable()> Public Class FundList
    Inherits List(Of Fund)

    Private _NDFDeets As dsFund.NDFDeetsDataTable
    Public Property NDFDeets() As dsFund.NDFDeetsDataTable
        Get
            Return _NDFDeets
        End Get
        Set(ByVal value As dsFund.NDFDeetsDataTable)
            _NDFDeets = value
        End Set
    End Property



    Function GetFundByName(ByVal FundName As String) As Fund
        Dim myFund As Fund = Nothing
        For Each f As Fund In My.Settings.AllFunds
            If f.FundName.ToLower.Trim = FundName.ToLower.Trim Then
                myFund = f
            End If
        Next
        Return myFund
    End Function

    Sub New()

    End Sub

    Function PopulateFund(ByVal FundName As String) As Fund
        Dim myFund As Fund = Me.GetFundByName(FundName)
        If myFund Is Nothing Then
            Return New Fund(FundName)
        Else
            Return myFund
        End If
    End Function
End Class
